cmake_minimum_required(VERSION 3.27)

project(H264_JM86 C)

set(CMAKE_C_STANDARD 99)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon")

message("CMAKE_BINARY_DIR is ${CMAKE_BINARY_DIR}")
# 设置所有可执行文件输出到 <build>/bin 目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)


set(target H264_encode)
message("CMAKE_CURRENT_SOURCE_DIR is ${CMAKE_CURRENT_SOURCE_DIR}")
file(GLOB encode_src ${CMAKE_CURRENT_SOURCE_DIR}/lencod/src/*.c)

message("encode_src is ${encode_src}")
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/lencod/inc)

# 设置单个可执行文件的输出路径
#set_target_properties(${target}  PROPERTIES
#        RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin/"
#)

add_executable(${target}  ${encode_src})




#set(target H264_decode)
#message("CMAKE_CURRENT_SOURCE_DIR is ${CMAKE_CURRENT_SOURCE_DIR}")
#file(GLOB decode_src ${CMAKE_CURRENT_SOURCE_DIR}/ldecod/src/*.c)
#
#message("decode_src is ${decode_src}")
#include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/ldecod/inc)
#
#add_executable(${target}  ${decode_src})
